unit uAdvertismentMoney;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, Grids, DBGridEh, StdCtrls, Mask, DBCtrlsEh, DBLookupEh,
  ComCtrls, ToolWin;

type
  TfAdvertismentMoney = class(TForm)
    ToolBar1: TToolBar;
    ToolButton3: TToolButton;
    ToolButton6: TToolButton;
    DateTimePicker1: TDateTimePicker;
    ToolButton2: TToolButton;
    ToolButton5: TToolButton;
    DBLookupComboboxEh1: TDBLookupComboboxEh;
    ToolButton4: TToolButton;
    ToolButton1: TToolButton;
    GroupBox1: TGroupBox;
    DBGridEh1: TDBGridEh;
    tbAdvertismentMoney: TToolBar;
    tbAddAdvertismentMoney: TToolButton;
    tbDelAdvertismentMoney: TToolButton;
    pmFilter: TPopupMenu;
    miDataFilterPeriod: TMenuItem;
    N6: TMenuItem;
    miDataDay: TMenuItem;
    miDataMonth: TMenuItem;
    miDataYear: TMenuItem;
    miDataAll: TMenuItem;
    procedure tbAddAdvertismentMoneyClick(Sender: TObject);
    procedure tbDelAdvertismentMoneyClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure DBGridEh1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fAdvertismentMoney: TfAdvertismentMoney;

implementation

uses uDBData;

{$R *.dfm}

procedure TfAdvertismentMoney.tbAddAdvertismentMoneyClick(Sender: TObject);
begin
  fDBData.InsertRecord(fDBData.dAdvertismentMoney);
end;

procedure TfAdvertismentMoney.tbDelAdvertismentMoneyClick(Sender: TObject);
begin
  fDBData.DeleteRecord(fDBData.dAdvertismentMoney);
end;

procedure TfAdvertismentMoney.FormCreate(Sender: TObject);
begin
  DateTimePicker1.Date := Date();
end;

procedure TfAdvertismentMoney.DBGridEh1KeyPress(Sender: TObject;
  var Key: Char);
begin
  if Key = #13 then fDBData.dAdvertismentMoney.DataSet.Post;
end;

end.
